/**
 * 以下路由需要登录后才可访问
 */
import Manage from '../views/Manage.vue'
import Home from '@/views/Home.vue'
import GoodsList from '@/views/goods/List.vue'
import AddGoods from '@/views/goods/Add.vue'
import UserList from '@/views/user/List.vue'
import AddUser from '@/views/user/Add.vue'
import OrderList from '@/views/order/List.vue'
import AddOrder from '@/views/order/Add.vue'


export default {
    path: '/manage',
    component: Manage,
    children: [
        {
            path: '',
            redirect: {
                name: 'Home'
            }
        },
        {
            path: 'home',
            name: 'Home',
            component: Home,
        },
        // /manage/goods -> /manage/goods/list 商品管理
        {
            path: 'goods',
            redirect: { name: 'GoodsList' }
        },
        {
            path: 'goods/list',
            name: 'GoodsList',
            component: GoodsList
        },
        {
            path: 'goods/add',
            name: 'AddGoods',
            component: AddGoods
        },
        {
            path: 'goods/edit',
            name: 'EditGoods',
            component: AddGoods
        },
// /manage/user -> /manage/user/list 用户管理

        {
            path: 'user',
            redirect: { name: 'UserList' }
        },
        {
            path: 'user/list',
            name: 'UserList',
            component: UserList
        },
        {
            path: 'user/add',
            name: 'AddUser',
            component: AddUser
        },
        {
            path: 'user/edit',
            name: 'EditUser',
            component: AddUser
        },
        //订单管理
        {
            path: 'order',
            redirect: { name: 'OrderList' }
        },
        {
            path: 'order/list',
            name: 'OrderList',
            component: OrderList
        },
        {
            path: 'order/add',
            name: 'AddOrder',
            component: AddOrder
        },
        {
            path: 'order/edit',
            name: 'EditOrder',
            component: AddOrder
        },

    ]
}